import java.util.HashMap;
import java.util.HashSet;
import java.util.Scanner;

public class Work01 {
    /*
    1
    1 1
    1 2 1
    1 3 3 1
    1 4 6 4 1
    . . . . . .
    * */
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int N = scanner.nextInt();
        int[][] arr = new int[100][100];
        HashMap<Integer, Integer> map = new HashMap<>();
        for (int i = 0; i < 100; i++) {
            for (int j = 0; j < 100; j++) {
                if(j == 0 || i == j){
                    arr[i][j] = 1;
                }
            }
        }
        /*for (int i = 0; i < 100; i++) {
            for (int j = 0; j < 100; j++) {
                System.out.print(arr[i][j] +" ");
            }
            System.out.println();
        }*/
        int count = 0;
        if(N == 1){
            System.out.println(1);
            return;
        }
        for (int i = 0; i < 100; i++) {
            for (int j = 0; j <= i; j++) {
                count++;
                if(!(j == 0 || i == j)){
                    arr[i][j] = arr[i-1][j] + arr[i-1][j-1];
                    if(arr[i][j] == N){
                        System.out.println(count);
                        return;
                    }
                }
            }
        }
    }
}
